const webpack = require('webpack')

module.exports = {
    publicPath: "/",
    devServer: {
        port: 23002,
        host: '0.0.0.0',
        proxy: {
            '/api': {
                // target: 'http://192.168.11.183:10008',
                target: 'http://127.0.0.1:23111',
                changeOrigin: true, //目标地址允许跨域
                pathRewrite:{    // 重写路径
                    '^/api':''
                }
            },
        }
    },
    // 关闭线上源码
    productionSourceMap: false,
    chainWebpack: (config) => {
        const svgRule = config.module.rule('svg');

        svgRule.uses.clear();

        svgRule
          .use('babel-loader')
          .loader('babel-loader')
          .end()
          .use('vue-svg-loader')
          .loader('vue-svg-loader');
      },

    chainWebpack: config => {
        config.plugin('provide').use(webpack.ProvidePlugin, [{
            $: 'jquery',
            jquery: 'jquery',
            jQuery: 'jquery',
            'window.jQuery': 'jquery'
        }])
    }
}
